home *** CD-ROM | disk | FTP | other *** search
/ Sunday Savers: Sharing Fun! I Know My Savior Lives / Sunday Savers: Sharing Fun! I Know My Savior Lives.iso / mac / Xtras / PrintOMatic MX 1.7.3 / PrintOMatic MX (Win32) / -PrintOMatic MX Demo.dir / 00034.txt < prev    next >
Encoding:
Text File  |  2004-04-06  |  3.5 KB  |  83 lines

  1. Setting Text and Graphic Attributes
  2.  
  3. The following routines are used to set the default text and graphic attributes of a document. These attributes determine the color, font, etc. of subsequently added document elements:
  4.  
  5.     setTextFont            Sets the default text font for non-styled text data
  6.     setTextSize            Sets the default text size for non-styled text data
  7.     setTextStyle        Sets the default text style for non-styled text data
  8.     setTextJust            Sets the line justification of text elements
  9.     setTextLineSpacing    Sets the line spacing of text elements
  10.     setColor            Sets the default color of text and graphic elements
  11.     setGray                Sets the default gray value of text and graphic elements
  12.     setLineWeight        Sets the line weight of stroked graphic elementssetTextFont
  13.  
  14. Syntax:    setTextFont document, fontName
  15.  
  16. Returns: TRUE if the requested font was available
  17.         FALSE if the requested font could not be found
  18.  
  19. This command sets the text font that will be applied to non-styled text data (such as strings) that are subsequently appended to the document object. If the requested font is not available, the default font (Geneva on the Macintosh, Arial on Windows) is used.
  20.  
  21. Note that the current font set using setTextFont will be overridden by the fonts, sizes and styles within styled text field cast members that you subsequently append to your document. The default font used for non-styled text data after appending a styled text field will be the last font contained within the text field.setTextSize
  22.  
  23. Syntax:    setTextSize document, fontSize
  24.  
  25. This command sets the text size that will be applied to non-styled text data (such as strings) that are subsequently appended to the document object.setTextStyle
  26.  
  27. Syntax:    setTextStyle document, styleString
  28.  
  29. This command sets the text style that will be applied to non-styled text data (such as strings) that are subsequently appended to the document object. The names of the style values correspond exactly to the Director "textStyle" property. Possible values for text styles are:
  30.  
  31.     normal
  32.     plain
  33.     bold
  34.     italic
  35.     underline
  36.  
  37. On the Macintosh, the following additional styles are available:
  38.  
  39.     outline
  40.     condense
  41.     extend
  42.     shadow
  43.  
  44. All values except normal or plain are added together in a call to setTextStyle, so you can combine a number of styles together in a single call.
  45.  
  46.  Example:
  47.  
  48. The following example creates a PrintOMatic document, sets the default font to bold italicized 10 point Helvetica, and prints a short text string:
  49.  
  50.     set doc = new(xtra "PrintOMatic")
  51.     if not objectP(doc) then exit
  52.     setTextStyle doc, "bold, italic"
  53.     setTextFont doc, "Helvetica"
  54.     setTextSize doc, 10
  55.     append doc, "Some sample text to print out."
  56.     if doJobSetup(doc) then print doc
  57.     set doc = 0setTextJust
  58.  
  59. Syntax:    setTextJust document, justCode(s)
  60.  
  61. The setTextJust command sets the line justification applied to all subsequently added text elements. Possible values are:
  62.  
  63.     left
  64.     right
  65.     centered 
  66.  
  67. Justification applies to an entire text block (or the set of linked text blocks), so if you set justification to "right" and call append for a block that was previously centered, the justification of the entire block will be changed to right-justified as the new text is added.setTextLineSpacing
  68.  
  69. Syntax:    setTextLineSpacing document, spacing
  70.  
  71. Sets the line spacing of text elements.setColor
  72.  
  73. Syntax:    setColor document, red, green, blue
  74.  
  75. Sets the default color of text and graphic elements.setGray
  76.  
  77. Syntax:    setGray document, grayLevel
  78. Sets the default gray value of text and graphic elements.setLineWeight
  79.  
  80. Syntax:    setLineWeight document, lineWeight
  81.  
  82. Sets the line weight of stroked graphic elements.
  83.